Repository navigation
Conversation
…kspace The drag controller moves windows with absolute coordinates, which never changes the monitor or workspace Hyprland files them under. A window dropped on another monitor kept reporting its old monitor, so the overlay for that monitor hosted the controls at coordinates outside its screen and the buttons disappeared. When a drag finishes, MOUSE_FIRST.adopt now checks which monitor the window landed on and, if it changed, moves the window to that monitor's active workspace and re-applies the final geometry. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Closing this one. I've ended up keeping these changes as customizations to my own copy instead of sending them upstream - my setup has grown into a fork with a pile of local tweaks (multi-monitor dragging, resizing a window to the monitor it lands on, tiling on double-click), and I'd rather not keep maintaining those as pull requests against your tree. Nothing here is wasted if you ever want the fix anyway: the description above covers the problem and the approach, and Thanks for the plugin - the v0.2 rewrite made all of this possible. |
Problem
After dragging a window to another monitor with the top-edge strip (or SUPER + drag), the minimize, maximize and close buttons disappear.
The drag controller moves windows with
hl.dsp.window.move({ x, y, relative = false }). That changes the window's position but not the monitor or workspace Hyprland files it under. So once the drag ends,win.monitorstill names the old monitor, andwinMonitorfalls back to it. The old monitor's overlay keeps hosting the controls at coordinates outside its own screen, so they can't be seen.Reproduced on Hyprland 0.56.2 with two monitors (DP-1 3440×1440 at 0,0 and DP-2 1920×1080 at 3440,0): a floating window moved to x=4000 still reported
monitor: DP-1,workspace: 1.Fix
src/lua/mousefirst.lua: newMOUSE_FIRST.adopt(address, x, y, w, h). It finds the monitor under the window's top-center point, using the same logical size calculation asmonitor_state. If that differs from the window's current monitor, it moves the window to that monitor's active workspace (follow = true) and re-applies the final size and position, because the workspace move shifts floating windows on its own.src/js/hypr.js:evalAdopt()builder.src/DragController.qml:_finish()calls it after the final move or snap. Both overlay drags and handed-over native drags go through this path.It does nothing when the window stays on the same monitor.
Testing
node --test tests/*.test.mjs: 18/18 pass.MOUSE_FIRST.adopt. Afterwards Hyprland reportedmonitor: DP-2,workspace: 2at the same position, andmousefirst statusshowed the active window on DP-2.🤖 Generated with Claude Code